home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 April: Mac OS SDK / Dev.CD Apr 98 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / AIncludes / FileTransfers.a < prev    next >
Encoding:
Text File  |  1998-02-12  |  10.3 KB  |  410 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        FileTransfers.a
  3. ;
  4. ;    Contains:    CommToolbox File Transfer Manager Interfaces.
  5. ;
  6. ;    Version:    Technology:    System 7.5
  7. ;                Release:    Universal Interfaces 3.1
  8. ;
  9. ;    Copyright:    © 1988-1998 by Apple Computer, Inc., all rights reserved
  10. ;
  11. ;    Bugs?:        Please include the the file and version information (from above) with
  12. ;                the problem description.  Developers belonging to one of the Apple
  13. ;                developer programs can submit bug reports to:
  14. ;
  15. ;                    devsupport@apple.com
  16. ;
  17. ;
  18.     IF &TYPE('__FILETRANSFERS__') = 'UNDEFINED' THEN
  19. __FILETRANSFERS__ SET 1
  20.  
  21.     IF &TYPE('__CONDITIONALMACROS__') = 'UNDEFINED' THEN
  22.     include 'ConditionalMacros.a'
  23.     ENDIF
  24.     IF &TYPE('__STANDARDFILE__') = 'UNDEFINED' THEN
  25.     include 'StandardFile.a'
  26.     ENDIF
  27.     IF &TYPE('__CTBUTILITIES__') = 'UNDEFINED' THEN
  28.     include 'CTBUtilities.a'
  29.     ENDIF
  30.     IF &TYPE('__CONNECTIONS__') = 'UNDEFINED' THEN
  31.     include 'Connections.a'
  32.     ENDIF
  33.     IF &TYPE('__FILES__') = 'UNDEFINED' THEN
  34.     include 'Files.a'
  35.     ENDIF
  36.     IF &TYPE('__TERMINALS__') = 'UNDEFINED' THEN
  37.     include 'Terminals.a'
  38.     ENDIF
  39.  
  40.  
  41. curFTVersion                    EQU        2                    ; current file transfer manager version
  42.  
  43.                                                             ; FTErr    
  44. ftGenericError                    EQU        -1
  45. ftNoErr                            EQU        0
  46. ftRejected                        EQU        1
  47. ftFailed                        EQU        2
  48. ftTimeOut                        EQU        3
  49. ftTooManyRetry                    EQU        4
  50. ftNotEnoughDSpace                EQU        5
  51. ftRemoteCancel                    EQU        6
  52. ftWrongFormat                    EQU        7
  53. ftNoTools                        EQU        8
  54. ftUserCancel                    EQU        9
  55. ftNotSupported                    EQU        10
  56. ; typedef OSErr                         FTErr
  57.  
  58.  
  59. ftIsFTMode                        EQU        $01
  60. ftNoMenus                        EQU        $02
  61. ftQuiet                            EQU        $04
  62. ftConfigChanged                    EQU        $10
  63. ftSucc                            EQU        $80
  64. ; typedef unsigned long                 FTFlags
  65.  
  66.  
  67. ftSameCircuit                    EQU        $01
  68. ftSendDisable                    EQU        $02
  69. ftReceiveDisable                EQU        $04
  70. ftTextOnly                        EQU        $08
  71. ftNoStdFile                        EQU        $10
  72. ftMultipleFileSend                EQU        $20
  73. ; typedef unsigned short                 FTAttributes
  74.  
  75.  
  76. ftReceiving                        EQU        0
  77. ftTransmitting                    EQU        1
  78. ftFullDuplex                    EQU        2                    ; (16) added ftFullDuplex bit.
  79. ; typedef unsigned short                 FTDirection
  80.  
  81. ;     application routines type definitions 
  82.  
  83.  
  84. ; typedef FTRecord *                    FTPtr
  85.  
  86. ; typedef FTPtr *                        FTHandle
  87.  
  88. FTRecord                RECORD 0
  89. procID                     ds.w    1                ; offset: $0 (0)
  90. flags                     ds.l    1                ; offset: $2 (2)
  91. errCode                     ds.w    1                ; offset: $6 (6)
  92. refCon                     ds.l    1                ; offset: $8 (8)
  93. userData                 ds.l    1                ; offset: $C (12)
  94. defProc                     ds.l    1                ; offset: $10 (16)
  95. config                     ds.l    1                ; offset: $14 (20)
  96. oldConfig                 ds.l    1                ; offset: $18 (24)
  97. environsProc             ds.l    1                ; offset: $1C (28)
  98. reserved1                 ds.l    1                ; offset: $20 (32)
  99. reserved2                 ds.l    1                ; offset: $24 (36)
  100. ftPrivate                 ds.l    1                ; offset: $28 (40)
  101. sendProc                 ds.l    1                ; offset: $2C (44)
  102. recvProc                 ds.l    1                ; offset: $30 (48)
  103. writeProc                 ds.l    1                ; offset: $34 (52)
  104. readProc                 ds.l    1                ; offset: $38 (56)
  105. owner                     ds.l    1                ; offset: $3C (60)
  106. direction                 ds.w    1                ; offset: $40 (64)
  107. theReply                 ds        SFReply            ; offset: $42 (66)
  108. writePtr                 ds.l    1                ; offset: $8C (140)
  109. readPtr                     ds.l    1                ; offset: $90 (144)
  110. theBuf                     ds.l    1                ; offset: $94 (148)
  111. bufSize                     ds.l    1                ; offset: $98 (152)
  112. autoRec                     ds        Str255            ; offset: $9C (156)
  113. attributes                 ds.w    1                ; offset: $19C (412)
  114. sizeof                     EQU *                    ; size:   $19E (414)
  115.                         ENDR
  116. ; typedef unsigned short                 FTCompletionKind
  117.  
  118.  
  119.                                                             ; FTReadProc messages 
  120. ftReadOpenFile                    EQU        0                    ; count = forkFlags, buffer = pblock from PBGetFInfo 
  121. ftReadDataFork                    EQU        1
  122. ftReadRsrcFork                    EQU        2
  123. ftReadAbort                        EQU        3
  124. ftReadComplete                    EQU        4
  125. ftReadSetFPos                    EQU        6                    ; count = forkFlags, buffer = pBlock same as PBSetFPos 
  126. ftReadGetFPos                    EQU        7                    ; count = forkFlags, buffer = pBlock same as PBGetFPos 
  127.  
  128.                                                             ; FTWriteProc messages 
  129. ftWriteOpenFile                    EQU        0                    ; count = forkFlags, buffer = pblock from PBGetFInfo 
  130. ftWriteDataFork                    EQU        1
  131. ftWriteRsrcFork                    EQU        2
  132. ftWriteAbort                    EQU        3
  133. ftWriteComplete                    EQU        4
  134. ftWriteFileInfo                    EQU        5
  135. ftWriteSetFPos                    EQU        6                    ; count = forkFlags, buffer = pBlock same as PBSetFPos 
  136. ftWriteGetFPos                    EQU        7                    ; count = forkFlags, buffer = pBlock same as PBGetFPos 
  137.  
  138.                                                             ;    fork flags 
  139. ftOpenDataFork                    EQU        1
  140. ftOpenRsrcFork                    EQU        2
  141.  
  142. ;
  143. ; pascal FTErr InitFT(void )
  144. ;
  145.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  146.         IMPORT_CFM_FUNCTION InitFT
  147.     ENDIF
  148.  
  149. ;
  150. ; pascal Handle FTGetVersion(FTHandle hFT)
  151. ;
  152.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  153.         IMPORT_CFM_FUNCTION FTGetVersion
  154.     ENDIF
  155.  
  156. ;
  157. ; pascal short FTGetFTVersion(void )
  158. ;
  159.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  160.         IMPORT_CFM_FUNCTION FTGetFTVersion
  161.     ENDIF
  162.  
  163. ;
  164. ; pascal FTHandle FTNew(short procID, FTFlags flags, FileTransferSendUPP sendProc, FileTransferReceiveUPP recvProc, FileTransferReadUPP readProc, FileTransferWriteUPP writeProc, FileTransferEnvironsUPP environsProc, WindowPtr owner, long refCon, long userData)
  165. ;
  166.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  167.         IMPORT_CFM_FUNCTION FTNew
  168.     ENDIF
  169.  
  170. ;
  171. ; pascal void FTDispose(FTHandle hFT)
  172. ;
  173.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  174.         IMPORT_CFM_FUNCTION FTDispose
  175.     ENDIF
  176.  
  177. ;
  178. ; pascal FTErr FTStart(FTHandle hFT, FTDirection direction, const SFReply *fileInfo)
  179. ;
  180.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  181.         IMPORT_CFM_FUNCTION FTStart
  182.     ENDIF
  183.  
  184. ;
  185. ; pascal FTErr FTAbort(FTHandle hFT)
  186. ;
  187.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  188.         IMPORT_CFM_FUNCTION FTAbort
  189.     ENDIF
  190.  
  191. ;
  192. ; pascal FTErr FTSend(FTHandle hFT, short numFiles, FSSpecArrayPtr pFSSpec, FileTransferNotificationUPP notifyProc)
  193. ;
  194.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  195.         IMPORT_CFM_FUNCTION FTSend
  196.     ENDIF
  197.  
  198. ;
  199. ; pascal FTErr FTReceive(FTHandle hFT, FSSpecPtr pFSSpec, FileTransferNotificationUPP notifyProc)
  200. ;
  201.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  202.         IMPORT_CFM_FUNCTION FTReceive
  203.     ENDIF
  204.  
  205. ;
  206. ; pascal void FTExec(FTHandle hFT)
  207. ;
  208.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  209.         IMPORT_CFM_FUNCTION FTExec
  210.     ENDIF
  211.  
  212. ;
  213. ; pascal void FTActivate(FTHandle hFT, Boolean activate)
  214. ;
  215.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  216.         IMPORT_CFM_FUNCTION FTActivate
  217.     ENDIF
  218.  
  219. ;
  220. ; pascal void FTResume(FTHandle hFT, Boolean resume)
  221. ;
  222.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  223.         IMPORT_CFM_FUNCTION FTResume
  224.     ENDIF
  225.  
  226. ;
  227. ; pascal Boolean FTMenu(FTHandle hFT, short menuID, short item)
  228. ;
  229.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  230.         IMPORT_CFM_FUNCTION FTMenu
  231.     ENDIF
  232.  
  233. ;
  234. ; pascal short FTChoose(FTHandle *hFT, Point where, FileTransferChooseIdleUPP idleProc)
  235. ;
  236.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  237.         IMPORT_CFM_FUNCTION FTChoose
  238.     ENDIF
  239.  
  240. ;
  241. ; pascal void FTEvent(FTHandle hFT, const EventRecord *theEvent)
  242. ;
  243.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  244.         IMPORT_CFM_FUNCTION FTEvent
  245.     ENDIF
  246.  
  247. ;
  248. ; pascal Boolean FTValidate(FTHandle hFT)
  249. ;
  250.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  251.         IMPORT_CFM_FUNCTION FTValidate
  252.     ENDIF
  253.  
  254. ;
  255. ; pascal void FTDefault(Ptr *theConfig, short procID, Boolean allocate)
  256. ;
  257.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  258.         IMPORT_CFM_FUNCTION FTDefault
  259.     ENDIF
  260.  
  261. ;
  262. ; pascal Handle FTSetupPreflight(short procID, long *magicCookie)
  263. ;
  264.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  265.         IMPORT_CFM_FUNCTION FTSetupPreflight
  266.     ENDIF
  267.  
  268. ;
  269. ; pascal void FTSetupSetup(short procID, const void *theConfig, short count, DialogPtr theDialog, long *magicCookie)
  270. ;
  271.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  272.         IMPORT_CFM_FUNCTION FTSetupSetup
  273.     ENDIF
  274.  
  275. ;
  276. ; pascal Boolean FTSetupFilter(short procID, const void *theConfig, short count, DialogPtr theDialog, EventRecord *theEvent, short *theItem, long *magicCookie)
  277. ;
  278.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  279.         IMPORT_CFM_FUNCTION FTSetupFilter
  280.     ENDIF
  281.  
  282. ;
  283. ; pascal void FTSetupItem(short procID, const void *theConfig, short count, DialogPtr theDialog, short *theItem, long *magicCookie)
  284. ;
  285.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  286.         IMPORT_CFM_FUNCTION FTSetupItem
  287.     ENDIF
  288.  
  289. ;
  290. ; pascal void FTSetupXCleanup(short procID, const void *theConfig, short count, DialogPtr theDialog, Boolean OKed, long *magicCookie)
  291. ;
  292.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  293.         IMPORT_CFM_FUNCTION FTSetupXCleanup
  294.     ENDIF
  295.  
  296. ;
  297. ; pascal void FTSetupPostflight(short procID)
  298. ;
  299.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  300.         IMPORT_CFM_FUNCTION FTSetupPostflight
  301.     ENDIF
  302.  
  303. ;
  304. ; pascal Ptr FTGetConfig(FTHandle hFT)
  305. ;
  306.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  307.         IMPORT_CFM_FUNCTION FTGetConfig
  308.     ENDIF
  309.  
  310. ;
  311. ; pascal short FTSetConfig(FTHandle hFT, const void *thePtr)
  312. ;
  313.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  314.         IMPORT_CFM_FUNCTION FTSetConfig
  315.     ENDIF
  316.  
  317. ;
  318. ; pascal FTErr FTIntlToEnglish(FTHandle hFT, const void *inputPtr, Ptr *outputPtr, short language)
  319. ;
  320.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  321.         IMPORT_CFM_FUNCTION FTIntlToEnglish
  322.     ENDIF
  323.  
  324. ;  (16) chenged OSErr to FTErr
  325. ;
  326. ; pascal FTErr FTEnglishToIntl(FTHandle hFT, const void *inputPtr, Ptr *outputPtr, short language)
  327. ;
  328.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  329.         IMPORT_CFM_FUNCTION FTEnglishToIntl
  330.     ENDIF
  331.  
  332. ;  (16) chenged OSErr to FTErr
  333. ;
  334. ; pascal void FTGetToolName(short procID, Str255 name)
  335. ;
  336.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  337.         IMPORT_CFM_FUNCTION FTGetToolName
  338.     ENDIF
  339.  
  340. ;
  341. ; pascal short FTGetProcID(ConstStr255Param name)
  342. ;
  343.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  344.         IMPORT_CFM_FUNCTION FTGetProcID
  345.     ENDIF
  346.  
  347. ;
  348. ; pascal void FTSetRefCon(FTHandle hFT, long refCon)
  349. ;
  350.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  351.         IMPORT_CFM_FUNCTION FTSetRefCon
  352.     ENDIF
  353.  
  354. ;
  355. ; pascal long FTGetRefCon(FTHandle hFT)
  356. ;
  357.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  358.         IMPORT_CFM_FUNCTION FTGetRefCon
  359.     ENDIF
  360.  
  361. ;
  362. ; pascal void FTSetUserData(FTHandle hFT, long userData)
  363. ;
  364.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  365.         IMPORT_CFM_FUNCTION FTSetUserData
  366.     ENDIF
  367.  
  368. ;
  369. ; pascal long FTGetUserData(FTHandle hFT)
  370. ;
  371.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  372.         IMPORT_CFM_FUNCTION FTGetUserData
  373.     ENDIF
  374.  
  375. ;
  376. ; pascal void FTGetErrorString(FTHandle hFT, short id, Str255 errMsg)
  377. ;
  378.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  379.         IMPORT_CFM_FUNCTION FTGetErrorString
  380.     ENDIF
  381.  
  382. ;    These Async routines were added to InterfaceLib in System 7.5
  383. ;
  384.  
  385. ;
  386. ; pascal FTErr FTSendAsync(FTHandle hFT, short numFiles, FSSpecArrayPtr pFSSpec, FileTransferNotificationUPP notifyProc)
  387. ;
  388.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  389.         IMPORT_CFM_FUNCTION FTSendAsync
  390.     ENDIF
  391.  
  392. ;
  393. ; pascal FTErr FTReceiveAsync(FTHandle hFT, FSSpecPtr pFSSpec, FileTransferNotificationUPP notifyProc)
  394. ;
  395.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  396.         IMPORT_CFM_FUNCTION FTReceiveAsync
  397.     ENDIF
  398.  
  399. ;
  400. ; pascal FTErr FTCompletionAsync(FTHandle hFT, FTCompletionKind completionCall)
  401. ;
  402.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  403.         IMPORT_CFM_FUNCTION FTCompletionAsync
  404.     ENDIF
  405.  
  406.  
  407.     ENDIF ; __FILETRANSFERS__ 
  408.  
  409.